package entity;

import form.OfferAdd;

import java.sql.ResultSet;

/**
 * Created by LLAP on 2017/12/25.
 * Copyright (c) 2017 LLAP. All rights reserved.
 */
public class Offer extends Entity {
    public int oid;
    public String offer;
    public String address;
    public int builtyear;
    public String district;
    public String area;
    public String type;
    public String decor;
    public String direction;
    public double price;

    public Offer(ResultSet r) {
        super(
                "offer",
                new String[] {"编号", "类型", "地址", "建成年份", "片区", "面积", "房型", "装修", "朝向", "底价（万元）"}
        );
        super.setDataSource(r);
        super.addData();
    }

    public Offer() {
        this(null);
    }
    @Override
    public boolean isCellEditable(int row, int column) {
        if (column > 0) return true;
        return false;
    }

    @Override
    public void add() {
        OfferAdd frmAdd = new OfferAdd();
        frmAdd.setVisible(true);
    }

    @Override
    public void search() {
        new form.OfferSearch().setVisible(true);
    }
}
